home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / NET / IRDA / QOS.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  3KB  |  105 lines

  1. /*********************************************************************
  2.  *                
  3.  * Filename:      qos.h
  4.  * Version:       0.1
  5.  * Description:   Quality of Service definitions
  6.  * Status:        Experimental.
  7.  * Author:        Dag Brattli <dagb@cs.uit.no>
  8.  * Created at:    Fri Sep 19 23:21:09 1997
  9.  * Modified at:   Wed Dec  9 10:32:47 1998
  10.  * Modified by:   Dag Brattli <dagb@cs.uit.no>
  11.  * 
  12.  *     Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, All Rights Reserved.
  13.  *     
  14.  *     This program is free software; you can redistribute it and/or 
  15.  *     modify it under the terms of the GNU General Public License as 
  16.  *     published by the Free Software Foundation; either version 2 of 
  17.  *     the License, or (at your option) any later version.
  18.  *
  19.  *     Neither Dag Brattli nor University of Troms° admit liability nor
  20.  *     provide warranty for any of this software. This material is 
  21.  *     provided "AS-IS" and at no charge.
  22.  *
  23.  ********************************************************************/
  24.  
  25. #ifndef QOS_H
  26. #define QOS_H
  27.  
  28. #include <linux/config.h>
  29. #include <linux/skbuff.h>
  30.  
  31. #define PI_BAUD_RATE     0x01
  32. #define PI_MAX_TURN_TIME 0x82
  33. #define PI_DATA_SIZE     0x83
  34. #define PI_WINDOW_SIZE   0x84
  35. #define PI_ADD_BOFS      0x85
  36. #define PI_MIN_TURN_TIME 0x86
  37. #define PI_LINK_DISC     0x08
  38. #define PI_COMPRESSION   0x07 /* Just a random pick */
  39.  
  40.  
  41. #define IR_115200_MAX 0x3f
  42.  
  43. /* Baud rates (first byte) */
  44. #define IR_2400    0x01
  45. #define IR_9600    0x02
  46. #define IR_19200   0x04
  47. #define IR_38400   0x08
  48. #define IR_57600   0x10
  49. #define IR_115200  0x20
  50. #define IR_576000  0x40
  51. #define IR_1152000 0x80
  52.  
  53. /* Baud rates (second byte) */
  54. #define IR_4000000 0x01
  55.  
  56. /* Quality of Service information */
  57. typedef struct {
  58.     int value;
  59.     __u16 bits; /* LSB is first byte, MSB is second byte */
  60. } qos_value_t;
  61.  
  62. struct qos_info {
  63.     int  magic;
  64.  
  65.     qos_value_t baud_rate;       /* IR_11520O | ... */
  66.     qos_value_t max_turn_time;
  67.     qos_value_t data_size;
  68.     qos_value_t window_size;
  69.     qos_value_t additional_bofs;
  70.     qos_value_t min_turn_time;
  71.     qos_value_t link_disc_time;
  72.     
  73.     qos_value_t power;
  74. #ifdef CONFIG_IRDA_COMPRESSION
  75.     /* An experimental non IrDA field */
  76.     qos_value_t compression;
  77. #endif
  78. };
  79.  
  80. extern int baud_rates[];
  81. extern int data_size[];
  82. extern int min_turn_time[];
  83. extern int add_bofs[];
  84. extern int compression[];
  85.  
  86. void irda_init_max_qos_capabilies( struct qos_info *qos);
  87. void irda_qos_compute_intersection( struct qos_info *, struct qos_info *);
  88. int  irda_insert_qos_negotiation_params( struct qos_info *qos, __u8 *fp);
  89. void irda_qos_negotiate( struct qos_info *qos_rx, struct qos_info *qos_tx,
  90.              struct sk_buff *skb);
  91.  
  92. int msb_index ( __u16 byte);
  93. int byte_value( __u8 byte, int *array);
  94. int value_index( int value, int *array);
  95. int index_value( int index, int *array);
  96.  
  97. void irda_qos_bits_to_value( struct qos_info *qos);
  98.  
  99. #endif
  100.  
  101.  
  102.  
  103.  
  104.  
  105.